import { request } from '@/utils/request/request';
import type { BaseResponse } from '@/utils/request/request';
import { RequestEnum } from '@/enums/httpEnum';

export const commentApi = {
  upload: '/upload',
} as const;

export const uploadFile = (file: FormData) => {
  return request<BaseResponse<API.UploadResult>>({
    url: commentApi.upload,
    method: RequestEnum.POST,
    headers: { 'Content-Type': 'multipart/form-data' },
    data: file,
  });
};
